<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui树形组件</title>
    <link rel="stylesheet" href="http://localhost:8080/picture/statics/layui/css/layui.css?t=20180530-2" media="all">
</head>
<body>

    <!--树形组件元素-->
    <div id="resources"></div>
    <script src="http://localhost:8080/picture/statics/layui/layui.js"></script>
    <!--<script src="http://localhost:8080/picture/statics/layui/lay/modules/jquery.js"></script>-->
    <script>
        layui.use('tree', function(){
            var tree = layui.tree;
            console.log("tree:  " + typeof (tree));
            //渲染
            var inst1 = tree.render({
                elem: '#resources'  //绑定元素
                ,showCheckbox:true
                ,data: [{
                    title: '江西' //一级菜单
                    ,children: [{
                        title: '南昌' //二级菜单
                        ,children: [{
                            title: '高新区' //三级菜单
                            //…… //以此类推，可无限层级
                        }]
                    }]
                },{
                    title: '陕西' //一级菜单
                    ,children: [{
                        title: '西安' //二级菜单
                    }]
                }]
            });
        });
    </script>
</body>
</html>

